upstream group1.tizi.com {
    server  {{storage1x1}}:8081;
    server  {{storage1x2}}:8081;
}

server {
    listen 80;

    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Host $server_name;

    client_max_body_size     10m;
    client_body_buffer_size  128k;

    proxy_connect_timeout    20;
    proxy_read_timeout       60;
    proxy_send_timeout       60;
    proxy_buffer_size        64k;
    proxy_buffers            4 64k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;

    access_log off;

    location  ~*  /g1 {
        expires 30d;
        rewrite ^/g1/(.*) /$1 break;
        proxy_set_header Host image1.tizi.com;
        proxy_set_header   X-Forwarded-For  $remote_addr;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_pass      http://group1.tizi.com;
        #error_log /tmp/debug.log debug_http;
    }

}
